{include file="general/header.tpl"}
<div id="path">
	You are here: <a href="/index.php">Home</a> &raquo; <a href="index.php">Administration</a> &raquo; <a href="user_list.php">All Users</a>
</div>
<div id="main">
	{assign var="session_name" value=#SessionName#}
	<form action="user_list.php" method="post">
		<div class="search-form-field">
			<label>Filter by username:</label>
			<input type="text" name="username" value="{$smarty.session.$session_name.username_search_string|escape}" /> <input type="submit" name="{$smarty.const.PAGINATION_RESET_FIELD_NAME}" value="Search" /> ({$smarty.const.WILDCARD_SIGN} for wildcards)
		</div>
	</form>
	{if $delete_user}
		<br />
		<div class="success">Username {$delete_user} has been deleted successfully.</div>
	{/if}
	<br />
	{if $paginate.total > 0 && $paginate.current_item <= $paginate.total}
		<div class="center">
			{include file="general/pagination_item_range.tpl"}
			<br /><br />
		</div>
	{/if}
	<table>
		<tr>
			<td class="item_header_cell numbers">#</td>
			<td class="item_header_cell no-overflow">Username</td>
			<td class="item_header_cell no-overflow">From</td>
			<td class="item_header_cell no-overflow">Latest</td>
			<td class="item_header_cell actions">Action</td>
		</tr>
		{counter start=$paginate.first-1 print=false}
		{foreach $users as $user}
			<tr>
				<td class="item_cell numbers">{counter skip="0"}.</td>
				<td class="item_cell no-overflow">{$user.username}</td>
				<td class="item_cell no-overflow">{if $user.ip}{$user.ip}{else}Never logged in{/if}</td>
				<td class="item_cell no-overflow">{if $user.last_login}{$user.last_login}{else}Never logged in{/if}</td>
				<td class="item_cell actions">{if !in_array(strtolower($user.username), explode(',', #SuperAdmins#))}<a href="user_edit.php?id={$user.id}"><img src="../images/edit.gif" alt="Edit" title="Edit" /></a> <a href="?delete={$user.id}" onclick="if (!confirm('Are you sure you want to delete this username?\n\n{counter skip="1"}. {$user.username}')) return false;"><img src="../images/delete.gif" alt="Delete" title="Delete" /></a>{else}<img src="../images/edit_gray.gif" alt="Edit" title="Edit" /> <img src="../images/delete_gray.gif" alt="Delete" title="Delete" />{counter skip="1" print=false}{/if}</td>
			</tr>
		{foreachelse}
			<tr><td colspan="5"><p class="center">No user matches found in the database.</p></td></tr>
		{/foreach}
	</table>
	{if $user@show}
		<div class="center">
			<br />
			{include file="general/pagination_page_number.tpl"}
		</div>
	{/if}
</div>
{include file="general/left.tpl"}
{include file="general/footer.tpl"}